package com.scheduled.lesson.springbootscheduledasync.service;

import com.sun.xml.internal.ws.client.AsyncResponseImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

import java.util.concurrent.Future;

/**
 * @Author gusheng
 * @Date 2021/1/8 14:43
 * @ClassName 类名称
 * @Description 类描述
 * @Version 3.4
 */
@Component
public class MyTask {

    @Async("myTaskExecutor")
    public Future tesk1(){
        System.out.println("任务一执行了");
        return new AsyncResult("任务一执行了");
    }
    @Async("myTaskExecutor")
    public Future tesk2(){
        System.out.println("任务二执行了");
        return new AsyncResult("任务二执行了");

    }
    @Async("myTaskExecutor")
    public Future tesk3(){
        System.out.println("任务三执行了");
        return new AsyncResult("任务三执行了");

    }

}
